#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__title__ = '将TargetOpinionMain python项目转换为exe文件'
__author__ = '皮'
__email__ = 'pipisorry@126.com'
"""
from PyInstaller.__main__ import run
import os
versions = '17.7'

mubiao = u'dist/乱世小助手V%s.exe'%versions

yuanshi = 'dist/LsAssistant.exe'

# from shutil import copyfile
# from shutil import move
if __name__ == '__main__':
    opts = ['LsAssistant.py', '-F','-w','--icon=lb.ico']
    # opts = ['TargetOpinionMain.py', '-F', '-w']
    # opts = ['TargetOpinionMain.py', '-F', '-w', '--icon=TargetOpinionMain.ico','--upx-dir','upx391w']
    run(opts)
#     copyfile('dist/LsAssistant.exe',u'dist/乱世小助手V10.0.exe')
    if os.path.exists(mubiao):
        os.remove(mubiao)
    os.rename(yuanshi,mubiao)
#     move('dist/LsAssistant.exe',u'dist/乱世小助手V10.1.exe')
# if __name__ == '__main__':
#     opts = ['LsAssistant.spec', '-F','-w','--icon=lb.ico']
#     # opts = ['TargetOpinionMain.py', '-F', '-w']
#     # opts = ['TargetOpinionMain.py', '-F', '-w', '--icon=TargetOpinionMain.ico','--upx-dir','upx391w']
#     run(opts)